package com.jida.tijian.mapper;

import com.jida.tijian.domain.Checkitemdetailed;
import com.jida.tijian.domain.Cidetailedreport;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CheckitemdetailedMapper {
    int deleteByPrimaryKey(Integer cdId);

    int insert(Checkitemdetailed record);

    int insertSelective(Checkitemdetailed record);

    Checkitemdetailed selectByPrimaryKey(Integer cdId);

    int updateByPrimaryKeySelective(Checkitemdetailed record);

    int updateByPrimaryKey(Checkitemdetailed record);

    @Select("SELECT cd.cdId, cd.name, cd.unit, cd.minrange, cd.maxrange, cd.normalValue, cd.normalValueString, cd.type, cd.ciId " +
            "FROM setmeal s,setmealdetailed sd,checkitem c,checkitemdetailed cd " +
            "WHERE s.smId = sd.smId " +
            "AND sd.ciId = c.ciId " +
            "AND c.ciId = cd.ciId " +
            "AND s.smId = #{smId} ")
    List<Cidetailedreport> selectBySmId(Integer smId);
}